import java.util.ArrayList;
import java.util.Stack;

public abstract class Main extends Abstract{

    public static void main(String[] args) {
        String[] s={"2","1","+","3","*"};
        System.out.println(evalRPN(s));
    }

    public static int evalRPN(String[] tokens) {
        Stack<Integer> stack =new Stack<>();
        for(int i=0;i<tokens.length;i++){
            if(tokens[i]!="+"&&tokens[i]!="-"&&tokens[i]!="*"&&tokens[i]!="/"){
                int dig=Integer.parseInt(tokens[i]);
                stack.push(dig);
            }else{
                int num2=stack.pop();
                int num1=stack.pop();
                switch(tokens[i]){
                    case "+":
                        stack.push(num1+num2);
                        break;

                    case "-":
                        stack.push(num1-num2);
                        break;

                    case "*":
                        stack.push(num1*num2);
                        break;

                    case "/":
                        stack.push(num1/num2);
                        break;
                }
            }
        }
        return stack.peek();
    }
    }